//
//  favoritesCollectionViewCell.m
//  uniform
//
//  Created by Apple on 15/8/28.
//  Copyright (c) 2015年 giuseppe. All rights reserved.
//

#import "favoritesCollectionViewCell.h"

@implementation favoritesCollectionViewCell



- (id)initWithFrame:(CGRect)frame{
    
    self = [super initWithFrame:frame];
    if (self) {
        
        self.imageView = [[UIImageView alloc]init];
        [self addSubview:self.imageView];
        
        
        self.nameLabel = [[UILabel alloc]init];
        self.nameLabel.textAlignment = NSTextAlignmentCenter;
        [self addSubview:self.nameLabel];
        
        
        self.soldNumberLabel = [[UILabel alloc]init];
        self.soldNumberLabel.textAlignment = NSTextAlignmentCenter;
        [self addSubview:self.soldNumberLabel];
        
        
        self.addShoppingCartButton = [UIButton buttonWithType:UIButtonTypeCustom];
        [self.addShoppingCartButton setImage:[UIImage imageNamed:@"add_trolley"] forState:UIControlStateNormal];
        [self addSubview:self.addShoppingCartButton];
        
        
        self.lineImageView = [[UIImageView alloc]init];
        self.lineImageView.backgroundColor = [UIColor grayColor];
        [self addSubview:self.lineImageView];
        
    }
    return self;
    
}


- (void)layoutSubviews {
    
    self.nameLabel.text = self.model.name;
    self.soldNumberLabel.text = self.model.amount;
    [self.imageView sd_setImageWithURL:[NSURL URLWithString:self.model.imgurl]];
    [self.addShoppingCartButton setTitle:self.model.price forState:UIControlStateNormal];
    NSLog(@"%@",self.model.price);
    
    
}



@end
